package org.axon.jmsexample.service;

import org.axon.jmsexample.model.Order;
import org.axon.jmsexample.util.Method;
import org.axon.jmsexample.util.SocialType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrderService {
	static int orderSequence = 1;

	@Autowired
	private OrderSender orderSender;

	public void setOrderSender(OrderSender orderSender) {
		this.orderSender = orderSender;
	}

	public void sendOrder(SocialType socialType, Method method) {
		Order order = new Order();
		order.setSocialType(socialType);
		order.setMethod(method);
		
		orderSender.sendOrder(order);
	}
}